import requests
import pytest
from typing import Dict


def add_user(s, base_url, test_input: dict):
    url = f"{base_url}prod-api/system/user"
    body = {"deptId": 102,
            # "userName": "jssq1",
            # "nickName": "123",
            "password": "123456",
            "phonenumber": "",
            "email": "",
            "sex": "0",
            "status": "0",
            "remark": "ccc",
            "postIds": [1],
            "roleIds": [2]
            }
    if test_input:
        body.update(test_input)
    r = s.post(url, json=body)
    return r


def user_list(s, base_url, test_input: dict):
    url = f"{base_url}prod-api/system/user/list"
    user_data = {

    }

    if test_input:
        user_data.update(test_input)
    print(user_data)
    r = s.get(url, params=user_data)
    print(r.text)
    return r
